package com.example.mvc.context;

import com.example.common.utils.Statistics;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

@Slf4j
@WebServlet("/my-servlet")
public class MyServlet extends HttpServlet {

    private MyServlet(){
        Statistics.logInfo(log);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        Statistics.logInfo(log, "doGet", request);
        response.getWriter().write("hello my servlet!");
    }
}
